
module Cms
  class Container < Fragment
    
    
    state_defined_by :draggable => true, :layout => nil
    
    def initialize(attrs = {})
#      attrs[:style] ||= ''
#      attrs[:style] += ';position:absolute';
      super(attrs)
      self.draggable = true
      self.layout = Layout::Flow.new
    end

    def build
      self.layout = self.layout.init
      e :script, "
          dcat_instance.oninit(function(Y) {
            /*this.droppable('##{id}', #{});*/
            new Cat.Fragment(document.getElementById('#{id}'), #{options});
          });
      "
    end
  end
end
